]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Handle networks with no access points
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 2 Mar 2018 22:31:36 +0000 (23:31 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Thu, 31 May 2018 11:42:14 +0000 (11:42 +0000)
This avoids a couple of warnings when encountering such a network.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/76

js/ui/status/network.js

index a75993612b5b0418b26306afe5797f8636ea0ed7..a71297eed6fdd36d91b6d22fb42155d928050a89 100644 (file)
@@ -995,8 +995,16 @@ var NMWirelessDialog = new Lang.Class({
         else if (!oneHasConnection && twoHasConnection)
             return 1;
 
-        let oneStrength = one.accessPoints[0].strength;
-        let twoStrength = two.accessPoints[0].strength;
+        let oneAp = one.accessPoints[0] || null;
+        let twoAp = two.accessPoints[0] || null;
+
+        if (oneAp != null && twoAp == null)
+            return -1;
+        else if (oneAp == null && twoAp != null)
+            return 1;
+
+        let oneStrength = oneAp.strength;
+        let twoStrength = twoAp.strength;
 
         // place stronger connections first
         if (oneStrength != twoStrength)